#encoding: utf-8

from flask import Blueprint,request,jsonify
import qiniu

bp = Blueprint("common",__name__,url_prefix='/c')


@bp.route('/')
def index():
    return 'common index'

@bp.route('/uptoken/')
def uptoken():
    access_key = '7iahvMjM9zTLV3t7Xh6VgmbBhi45mQGyF6yRGc5m'
    secret_key = 'nXDJMyxObcO2betUdan69dUhXQn9dxHWPXedmPk7'
    q = qiniu.Auth(access_key,secret_key)
    bucket_name = 'dxqspace'
    token = q.upload_token(bucket_name)
    return jsonify({'uptoken':token})